﻿using System.Windows.Media.Imaging;

namespace bilibili下载.Interface
{
    public interface IAVInfo
    {
        /// <summary>
        /// 视频名称
        /// </summary>
        string Name { get; }

        /// <summary>
        /// 视频封面图片
        /// </summary>
        BitmapImage Image { get; }

        /// <summary>
        /// 是否选中下载
        /// </summary>
        bool Checked { get; set; }

        /// <summary>
        /// 下载进度百分比
        /// </summary>
        double Percentage { get; }

        /// <summary>
        /// 下载速度
        /// </summary>
        double SecondSpeed { get; }

        /// <summary>
        /// 平均下载速度
        /// </summary>
        double AverageSecondSpeed { get; }

        /// <summary>
        /// 视频总长度
        /// </summary>
        long TotalLen { get; }

        /// <summary>
        /// 已下载长度
        /// </summary>
        long ReceivedSize { get; }

        /// <summary>
        /// 视频状态
        /// </summary>
        State State { get; set; }

        /// <summary>
        /// 下载视频
        /// </summary>
        /// <param name="path">保存路径</param>
        void Download(string path);
    }

    public enum State
    {
        /// <summary>
        /// 初始状态
        /// </summary>
        None = 0,

        /// <summary>
        /// 等待下载
        /// </summary>
        Await,

        /// <summary>
        /// 正在下载
        /// </summary>
        Underway,

        /// <summary>
        /// 完成
        /// </summary>
        Finish
    }
}